<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
  
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">一般仓储供方列表</li>
    </ol>
  
    <div class="ms-content-layout has-operation">


      <div class="ms-operation-bar no-margin no-bottom-border clearfix">
        <div class="ms-operation-group pull-right">
          <a href="${ctx.host}/common-storage-suppliers/search" data-target="#search" data-toggle="modal" class="btn ms-btn ms-btn-blue">
            <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
          </a>
        </div>
      </div>

      <table class="table table-hover ms-table">
        <thead>
          <tr>
             <th>序号</th>
             <th>公司代码</th>
             <th>公司名称</th>
             <th>所属级别</th>
             <th>默认分区</th>
             <th>供方类型</th>
             <th>供方审核状态</th>
             <th>更新时间</th>
             <th class="text-center">操作</th>
          </tr>
        </thead>
  
        <tbody>
          <c:forEach items="${suppliers}" var="supplier" varStatus="status"> 
            <tr>
              <td>${status.count}</td>
              <td>${supplier.code}</td>
              <td>${supplier.name}</td>
              <td>${supplier.level.description}</td>
              <td>${supplier.branch.name}</td>
              <td>${supplier.type.description}</td>
              <td>
                ${supplier.status.description}
                <c:if test="${supplier.status.rejected}">(${persist.supplierRejectEvent(supplier.id).reason})</c:if>
              </td>

              <td><fmt:formatDate value="${supplier.lastModifyTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
              <td>
              
                <a href="${ctx.host}/suppliers/${supplier.id}?supplierMenuType=self">详情</a>&nbsp;&nbsp;
                
     <%--           <c:if test="${supplier.status.rejected}">
                  <a href="${ctx.host}/suppliers/${supplier.id}/reject" data-target="#change" data-toggle="modal">驳回意见</a>&nbsp;&nbsp;
                </c:if>
                
                <c:if test="${supplier.status.couldChange() or (supplier.status.qualified and !supplier.syncStatus.modified) or supplier.syncStatus.adopt or supplier.syncStatus.rejected}">
                  <a href="${ctx.host}/suppliers/${supplier.id}/change" data-target="#change" data-toggle="modal">变更申报</a>&nbsp;&nbsp;
                </c:if>--%>
                
              </td>
            </tr>
          </c:forEach> 
        </tbody>
      
        <tfoot>
          <tr>
            <td colspan="10" class="no-vertical-padding">
               <c:if test="${empty currentPrincipal.supplierId}">
  	            <div class="pull-left">
                  <jsp:include page="/WEB-INF/include/page.jsp">
                    <jsp:param name="url" value="${ctx.host}/common-storage-suppliers"/>
                    <jsp:param name="queryString" value="${queryString}"/>
                  </jsp:include>
  	            </div>
              </c:if>
            </td>
          </tr>
        </tfoot>
      </table>
      
    </div>
  </div>

  <%@ include file="/WEB-INF/include/script.jsp" %>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/management/supplier-info-list.js"/>
  <script type="text/javascript">
    require(['page/supplier/management/supplier-info-list'], function (page) {
        page.init()
    })
  </script>

</body>
</html>